package com.seu.multithread.demo01;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * 发现主线程比子线程早结束
 *
 * @author liangfeihu
 * @since 2019/2/18
 */
public class Main01 {
    public static void main(String[] args) {
        System.out.println(Thread.currentThread().getName() + "主线程运行开始！");
        MyThread myThreadA = new MyThread("A");
        MyThread myThreadB = new MyThread("B");

        myThreadA.start();
        myThreadB.start();

        System.out.println(Thread.currentThread().getName() + "主线程运行结束！");

        AtomicInteger cxsNum = new AtomicInteger(0);
        System.out.println(cxsNum.incrementAndGet());
        System.out.println(cxsNum.get());
    }
}
